<template>
  <view>
    <uni-popup ref="popup" :is-mask-click="false">
      <view class="popup-wrap">
        <view class="content-wrap">
          <image :src="successIcon" mode="scaleToFill" class="icon" />
          <view class="message">{{isUpdate?'更新':'发布'}}成功！我们会尽快联系您</view>
          <view class="phone">联系电话：{{phoneNum}}</view>
        </view>
        <view class="footer-wrap" @click="linkToPlanManage">确认</view>
      </view>
    </uni-popup>
  </view>
</template>
<script>
  import config from '@/config';
  import { toast } from '@/utils/common.js';
  export default {
    props: {
      show: {
        type: Boolean,
        default: true
      },
      isUpdate: {
        type: Number,
        default: undefined
      },
      phoneNum: {
        type: String,
        default: undefined
      }
    },
    watch: {
      show(flag) {
        if (flag) {
          this.$refs.popup.open()
        } else {
          this.$refs.popup.close()
        }
      }
    },
    data() {
      return {
      }
    },
    computed: {
      successIcon() {
        return config.baseImgUrl + '/sucess.png';
      }
    },
    methods: {
      linkToPlanManage() {
        this.$tab.navigateBack()
      }
    }
  }
</script>
<style lang="scss" scoped>
  .popup-wrap {
    width: 600rpx;
    border-radius: 20rpx;
    background-color: #ffffff;
  }

  .content-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48rpx 48rpx 60rpx 48rpx;
    border-bottom: 2rpx solid #eaeaea;

    .icon {
      width: 220rpx;
      height: 188rpx;
    }

    .message {
      margin-top: 40rpx;
      font-size: 34rpx;
      font-weight: 500;
      color: #000000;
    }

    .phone {
      margin-top: 8rpx;
      font-size: 30rpx;
      color: #666666;
    }
  }

  .footer-wrap {
    height: 100rpx;
    line-height: 100rpx;
    color: #409EFE;
    text-align: center;
    font-size: 30rpx;
    font-weight: 500;
  }
</style>